<template>

  <el-row class="content">
    <div>
      <select  name="public-choice" @change="rult(geam)" v-model="geam" style="width:140px">
        <option :value="key" :selected="geam === key" v-for="(value, key, index) in gamee" >{{value}}</option>
      </select>
    </div>
    <div style="line-height: 20px" v-html="memberRule"></div>
    <el-row style="margin-top:10px;">

    </el-row>

  </el-row>
</template>

<script>
  import { mapGetters } from 'vuex'
  import { user as userMap } from '@/utils/map' // 参数映射

  export default {
    computed: {
      ...mapGetters(['memberGameSelected', 'memberRule']),
    },
    data() {
      return {
        loading: false,
        userMap: userMap, // 用户字段映射
        currentPage: 1,
        pageSize: 10,
        pickDate: null,
        geam: this.$store.getters.memberGameSelected, //类型参数,
        gamee: null,
      }
    },

    // 数据格式化
    filters: {},

    async created() {
      await this.fetchData()
    },

    methods: {
      async fetchData() {
        await this.$store.dispatch('MemberGameRule', {
          game: this.memberGameSelected,
        })
        await this.$store.dispatch('GetLotteriesGameOptions', {})
          .then(response => {
            this.gamee = response
          })
      },
      rult(index) {
        this.$store.dispatch('MemberGameRule', {
          game: index,
        })
      },
    },
    watch: {
      $route(to, from) {},
    },
  }
</script>
<style>
  .content {
    padding: 5px;
    margin-left: 190px;
  }
</style>

